package org.git.movie.videojiexi;

import com.alibaba.fastjson.JSON;
import org.git.movie.videojiexi.model.VideoModel;
import org.git.movie.videojiexi.service.VideoService;
import org.git.movie.videojiexi.service.impl.VideoFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

public class VideoManager {
    public final static Logger logger = LoggerFactory.getLogger(VideoManager.class);

    public static void mainV1(String[] args) throws Exception {
        VideoModel model = null;
        String url = "https://v.douyin.com/JkngUeD/";
        VideoService videoService = VideoFactory.getVideo(url);
        if(Objects.isNull(videoService)) {
            model =  new VideoModel();
        }else{
            model =  videoService.parseUrl(url,"");
        }
        logger.info(JSON.toJSONString(model));

    }
    public static void main(String[] args) throws Exception {
        VideoModel model = null;
//        String url = "https://kphshanghai.m.chenzhongtech.com/s/cRpTnwYj";
        String url2 = "https://v.douyin.com/JkngUeD/";
        VideoService videoService = VideoFactory.getVideo(url2);
        if(Objects.isNull(videoService)) {
            model =  new VideoModel();
        }else{
            model =  videoService.parseUrl(url2,null);
        }


        logger.info(JSON.toJSONString(model));

    }
}
